package com.boolib.animate.framework.web;

import com.boolib.animate.commons.base.BaseController;
import com.boolib.animate.framework.entity.AnimateSection;
import com.boolib.animate.framework.entity.QueryWorkSection;
import com.boolib.animate.framework.service.advice.AnimateSectionService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author nier
 * @create 2020-02-22 0:41
 */

@RequestMapping("/api/section")
@RestController
public class AnimateSectionController extends BaseController<AnimateSection> {

    @Autowired
    private AnimateSectionService animateSectionService;

    @GetMapping
    @Override
    public List<QueryWorkSection> get(

            @RequestParam(value = "page",defaultValue = "0") Integer page,
            @RequestParam(value = "size",defaultValue = "6") Integer size,
            @RequestParam(value = "sort",required = false) String sort,
            @RequestParam(value = "sortType",required = false) String  sortType
    ) {

        return animateSectionService.searchWorkSection();
    }
}
